package my.common;

import java.nio.ByteBuffer;

/**
 * @author fengbo
 */
public class File {

    public static int read(int fd, ByteBuffer buf, int pos, int limit) {
        return read0(fd, buf, pos, limit);
    }

    public static int write(int fd, ByteBuffer buf, int pos, int limit) {
        return write0(fd, buf, pos, limit);
    }

    public static int close(int fd) {
        return close0(fd);
    }

    private static native int read0(int fd, ByteBuffer buf, int pos, int limit);

    private static native int write0(int fd, ByteBuffer buf, int pos, int limit);

    private static native int close0(int fd);
}
